﻿@{
    ViewBag.Title = "Artist";
    Layout = "~/Views/Shared/_SecondLayout.cshtml";
}


@section Header
{
    <style type="text/css">
        /*#main {
            width: 960px;
            margin: 20px auto;
        }*/

        /* items */
        .items {
            width: 216px;
            border: 1px solid #dcdcdc;
            overflow: hidden;
            float: left;
            margin: 15px 15px 0 0;
            background-color: #fff;
        }

            .items .img {
                height: 300px;
                overflow: hidden;
                position: relative;
            }

            .items .desc {
                height: 270px;
                width: 186px;
                padding: 15px;
                position: absolute;
                top: -300px;
                left: 0px;
                color: #fff;
                background: #FFFFFF;
                opacity: 0.5;
                filter: alpha(opacity=70);
            }

            .items .title {
                border-top: 1px solid #dcdcdc;
                padding: 7px 14px;
            }

            .items a {
                display: block;
                width: 186px;
                height: 270px;
                overflow: hidden;
                position: absolute;
                left: 0;
                /*top: 0;*/
                z-index: 9;
            }
    </style>

    <script type="text/javascript">

        // 修正FF浏览器兼容
        function getOffset(e) {
            var target = e.target;
            if (target.offsetLeft == undefined) {
                target = target.parentNode;
            }
            var pageCoord = getPageCoord(target);
            var eventCoord = {
                x: window.pageXOffset + e.clientX,
                y: window.pageYOffset + e.clientY
            };
            var offset = {
                offsetX: eventCoord.x - pageCoord.x,
                offsetY: eventCoord.y - pageCoord.y
            };
            return offset;
        }

        function getPageCoord(element) {
            var coord = {
                x: 0,
                y: 0
            };
            while (element) {
                coord.x += element.offsetLeft;
                coord.y += element.offsetTop;
                element = element.offsetParent;
            }
            return coord;
        }

        $(document).ready(function () {

            $(".items .img").hover(function (e) {

                var _this = $(this), //闭包
                _desc = _this.find(".desc").stop(true),
                width = _this.width(), //取得元素宽
                height = _this.height(), //取得元素高
                left = (e.offsetX == undefined) ? getOffset(e).offsetX : e.offsetX, //从鼠标位置，得到左边界，利用修正ff兼容的方法
                top = (e.offsetY == undefined) ? getOffset(e).offsetY : e.offsetY, //得到上边界
                right = width - left, //计算出右边界
                bottom = height - top, //计算出下边界
                rect = {}, //坐标对象，用于执行对应方法。
                _min = Math.min(left, top, right, bottom), //得到最小值
                _out = e.type == "mouseleave", //是否是离开事件
                spos = {}; //起始位置

                rect[left] = function (epos) { //鼠从标左侧进入和离开事件
                    spos = { "left": -width, "top": 0 };
                    if (_out) {
                        _desc.animate(spos, "fast"); //从左侧离开
                    } else {
                        _desc.css(spos).animate(epos, "fast"); //从左侧进入
                    }
                };

                rect[top] = function (epos) { //鼠从标上边界进入和离开事件
                    spos = { "top": -height, "left": 0 };
                    if (_out) {
                        _desc.animate(spos, "fast"); //从上面离开
                    } else {
                        _desc.css(spos).animate(epos, "fast"); //从上面进入
                    }
                };

                rect[right] = function (epos) { //鼠从标右侧进入和离开事件
                    spos = { "left": left, "top": 0 };
                    if (_out) {
                        _desc.animate(spos, "fast"); //从右侧成离开
                    } else {
                        _desc.css(spos).animate(epos, "fast"); //从右侧进入
                    }
                };

                rect[bottom] = function (epos) { //鼠从标下边界进入和离开事件
                    spos = { "top": height, "left": 0 };
                    if (_out) {
                        _desc.animate(spos, "fast"); //从底部离开
                    } else {
                        _desc.css(spos).animate(epos, "fast"); //从底部进入
                    }
                };

                rect[_min]({ "left": 0, "top": 0 }); // 执行对应边界 进入/离开 的方法

            });

        });
    </script>
}
<div id="mainbody">
    <div id="mainpic"></div>
    <div id="main_back">
        <div id="left">
            <img src="/img/weixin.gif" />
        </div>
        <div id="main_l">
            <div id="main_m">
                <div id="main">

                    <div id="main-right">
                        <ul>
                            <li>

                                <div class="p_left_title">
                                    <img src="/img/pro_img.gif" />
                                    <div class="p_left_title_word">艺术家</div>
                                    @*<div class="p_left_title_more">&gt;&gt;更多</div>*@
                                </div>
                            </li>
                            <li>
                                <div id="pagelefttop">
                                    <ul class="pageleft_ul">
                                        @{
                                            IList<ArtistInfo> artist = ViewBag.Artist as List<ArtistInfo>;
                                            foreach (ArtistInfo item in artist)
                                            { 
                                            <li><a href="/Artist/ViewArtist?id=@item.ArtistID">@item.ArtistName</a></li> 
                                            }
                                        }
                                    </ul>
                                </div>
                            </li>
                            <li>
                                <div class="cu_1"></div>
                                <div class="cu_2">
                                    <p>电话：025-84716007 </p>
                                    <p>025-84718399 </p>
                                    <p>传真：025-84702477</p>
                                    <p>Email:jinding2002@163.com</p>
                                </div>
                                <div class="cu_3"></div>

                            </li>
                        </ul>
                    </div>
                    <div id="mainright">
                        <div id="bannerimg">
                            <img src="/img/艺术家.jpg" />
                        </div>
                        <div id="position" style="text-align: right; padding: 5px 0;">您当前的位置：<a href="/home/Index/">首页</a>&gt;&gt;<a href="/Artist/Artist/">艺术家</a></div>
                        <div class="mainright_top">
                            <img src="/img/list.gif" />
                            <div class="mainright_top_word">艺术家<span>Artist</span></div>
                        </div>
                        <div id="mainright_body">
                            @{
                                foreach (ArtistInfo item in artist)
                                {
                                    if (item.AttachmentList.Count > 0)
                                    {
                                <div class="items">
                                    <div class="img">
                                        <a href="/Artist/ViewArtist?id=@item.ArtistID"></a>
                                        <img style="height:300px;width:215px;" src ="/UploadFile/@item.AttachmentList[0].SaveName" alt="@item.ArtistName"  style="cursor:pointer;"/>
                                        <div class="desc">@item.ArtistName</div>
                                    </div>
                                    <div class="title">@item.ArtistName</div>
                                </div>
                                    }
                                    else
                                    {
                                <div class="items">
                                    <div class="img">
                                        <a href="/Artist/ViewArtist?id=@item.ArtistID"></a>
                                        <img src="/UploadFile/zanwu.jpg" alt="@item.ArtistName"  style="cursor:pointer;"/>
                                        <div class="desc">@item.ArtistName</div>
                                    </div>
                                    <div class="title"><a href="/Artist/ViewArtist?id=@item.ArtistID">@item.ArtistName</a></div>
                                </div>
                                    }
                                }
                            }
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div id="right">
            <img src='/img/ritght.gif' />
        </div>
    </div>
    <div id="footer_m">
        <div id="footer">
            <p><span>地址：南京市山西路67号世界贸易中心大厦A1幢1101室</span><span>邮编：210009 </span><span>电话：025-84716007 025-84718399</span><span> 传真：025-84702477</span></p>
            <p><span>网址：http://www.jsjdgg.com</span><span>Email:jinding2002@163.com</span></p>
            <div>
                苏ICP备09047781 江苏金鼎广告传播有限公司 版权所有 2009-2012
            </div>
        </div>
    </div>

</div>

@*<div>
    @{
        IList<ArtistInfo> artist = ViewBag.Artist as List<ArtistInfo>;
        foreach (ArtistInfo item in artist)
        { 
        <li><a href="/Adviser/ViewAdviser?id=@item.ArtistID">@item.ArtistName</a></li> 
        }
    }
</div>
<br />*@
@* 此位置加载顾问的照片信息 *@
@*<div id="main">
    @{
        foreach (ArtistInfo item in artist)
        {
            if (item.AttachmentList.Count > 0)
            {
        <div class="items">
            <div class="img">
                <img src="/UploadFile/@item.AttachmentList[0].SaveName" alt="@item.ArtistName"  style="cursor:pointer;"/>
                <div class="desc">@item.ArtistName</div>
            </div>
            <div class="title"><a href="/Artist/ViewArtist?id=@item.ArtistID">@item.ArtistName</a></div>
        </div>
            }
            else
            {
        <div class="items">
            <div class="img">
                <img src="/UploadFile/zanwu.jpg" alt="@item.ArtistName"  style="cursor:pointer;"/>
                <div class="desc">@item.ArtistName</div>
            </div>
            <div class="title"><a href="/Artist/ViewArtist?id=@item.ArtistID">@item.ArtistName</a></div>
        </div>
            }
        }
    }
</div>*@

